home *** CD-ROM | disk | FTP | other *** search
- package com.ibm.xml.parser.util;
-
- import com.ibm.xml.parser.Child;
- import com.ibm.xml.parser.Parent;
- import com.ibm.xml.parser.TXElement;
- import java.util.Enumeration;
- import javax.swing.tree.TreeNode;
- import org.w3c.dom.Node;
-
- public class TreeFactory$TreeElement extends TXElement implements TreeNode {
- public TreeFactory$TreeElement(String var1) {
- super(var1);
- }
-
- public Enumeration children() {
- return ((Parent)this).elements();
- }
-
- public boolean getAllowsChildren() {
- return true;
- }
-
- public TreeNode getChildAt(int var1) {
- return (TreeNode)((Parent)this).getChildNodes().item(var1);
- }
-
- public int getChildCount() {
- return ((Parent)this).getChildNodes().getLength();
- }
-
- public int getIndex(TreeNode var1) {
- int var2 = 0;
-
- for(Node var3 = ((Parent)this).getFirstChild(); var3 != null; var3 = var3.getNextSibling()) {
- if (var3 == var1) {
- return var2;
- }
-
- ++var2;
- }
-
- return -1;
- }
-
- public TreeNode getParent() {
- return (TreeNode)((Child)this).getParentNode();
- }
-
- public boolean isLeaf() {
- return !((Parent)this).hasChildNodes();
- }
-
- public String toString() {
- return ((TreeFactory)((Child)this).getFactory()).convertValueToText(this);
- }
- }
-